package com.seckill.domain;

import lombok.Data;

import java.math.BigDecimal;
import java.util.Date;

/**
 * 商品实体类
 */
@Data
public class Product {
    private Long id; // 商品ID
    private String name; // 商品名称
    private String description; // 商品描述
    private BigDecimal originalPrice; // 原价
    private BigDecimal seckillPrice; // 秒杀价
    private String imageUrl; // 商品图片
    private Integer status; // 状态(0-下架 1-上架)
    private Date createTime; // 创建时间
    private Long activityId;
    private Integer availableStock; // 可用库存
    private Integer totalStock; // 总库存

    // 可选：为演示添加默认图片URL
    public Product() {
        if (this.imageUrl == null) {
            this.imageUrl = "https://img14.360buyimg.com/n1/jfs/t1/123456/xx.jpg";
        }
    }

    // getter/setter
    public Long getId() { return id; }
    public void setId(Long id) { this.id = id; }
    public String getName() { return name; }
    public void setName(String name) { this.name = name; }
    public String getDescription() { return description; }
    public void setDescription(String description) { this.description = description; }
    public BigDecimal getOriginalPrice() { return originalPrice; }
    public void setOriginalPrice(BigDecimal originalPrice) { this.originalPrice = originalPrice; }
    public BigDecimal getSeckillPrice() { return seckillPrice; }
    public void setSeckillPrice(BigDecimal seckillPrice) { this.seckillPrice = seckillPrice; }
    public String getImageUrl() { return imageUrl; }
    public void setImageUrl(String imageUrl) { this.imageUrl = imageUrl; }
    public Integer getStatus() { return status; }
    public void setStatus(Integer status) { this.status = status; }
    public Date getCreateTime() { return createTime; }
    public void setCreateTime(Date createTime) { this.createTime = createTime; }
    public Integer getAvailableStock() { return availableStock; }
    public void setAvailableStock(Integer availableStock) { this.availableStock = availableStock; }
    public Integer getTotalStock() { return totalStock; }
    public void setTotalStock(Integer totalStock) { this.totalStock = totalStock; }
} 